Compiler

RSS for tag

Discuss the various compiler and toolchain technologies used in development.

Posts under Compiler tag

63 Posts

Post

Replies

Boosts

Views

Activity

🔥 Xcode 26 RC – visionOS App Icon Created with Icon Composer Appears Empty
App Icon created with Icon Composer is empty for visionOS app We are developing a universal app, and the app’s icon was created using Icon Composer. Xcode 26, RC visionOS 26 and visionOS 2.5 App Icons on macOS, iOS, and iPadOS are correct We have archived the app for macOS and iOS and successfully uploaded it to the App Store. This strongly suggests that the App Icon configuration in our project settings is correct for these platforms. App Icon issue on visionOS However, the visionOS app icon is not working as expected: When testing on the Vision Pro simulator (versions 2.x and 26.0), the app icon appears empty. When archiving and submitting to the App Store, the process fails with the following error: The app’s Info.plist file is missing the CFBundleIcons.CFBundlePrimaryIcon key for the visionOS App Icon. This suggests that the project’s App Icon settings may not be correctly applied for visionOS builds. Request for assistance We are preparing to release our app, one of the first to support Liquid Glass, and would greatly appreciate guidance on how to resolve this issue with the visionOS app icon. FB20184218
1
0
157
1w
system crashed when run java
My book env: MacBook Air Apple M4 15.6.1 (24G90) I installed JDK hs_err_pid6813.log by sdkman and homebrew, but when I ran java, os crashed: /opt/homebrew/o/openj/libexec/openjdk.jdk/Contents/Home/bin | stable ./javac --verison ABRT | 12:32:20 # # A fatal error has been detected by the Java Runtime Environment: # # SIGBUS (0xa) at pc=0x000000010211b340, pid=7237, tid=9987 # # JRE version: (21.0.7) (build ) # Java VM: OpenJDK 64-Bit Server VM (21.0.7, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-aarch64) # Problematic frame: # V [libjvm.dylib+0x35f340] CodeHeap::allocate(unsigned long)+0x15c # # No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again # # An error report file with more information is saved as: # /opt/homebrew/Cellar/openjdk@21/21.0.7/libexec/openjdk.jdk/Contents/Home/bin/hs_err_pid7237.log # # [1] 7237 abort ./javac --verison Does that mean I have to reinstall OSX?
2
0
404
2w
Cannot compile a simple C++ program on Mac OS
I'm trying to compile a simple hello world C++ program on my MacBook Pro. I have a M3 Pro (Nov 2023) running Sequoia 15.6. The program is: #include <iostream> int main() { std::cout << "Hello World!"; return 0; } The error I get is: In file included from test.cpp:1: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/iostream:42: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/ios:220: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__locale:15: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/shared_ptr.h:13: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__compare/compare_three_way.h:13: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__compare/three_way_comparable.h:12: In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__compare/common_comparison_category.h:15: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cstddef:42:5: error: <cstddef> tried including <stddef.h> but didn't find libc++'s <stddef.h> header. This usually means that your header search paths are not configured properly. The header search paths should contain the C++ Standard Library headers before any C Standard Library, and you are probably using compiler flags that make that not be the case. 42 | # error <cstddef> tried including <stddef.h> but didn't find libc++'s <stddef.h> header. \ | ^ However, I can see stddef.h in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/ and in /usr/local/include
2
0
80
4w
Compile Failure on NSXPCInterface Initializer
I have a project that leverages XPC and has interoperability between Swift and Objective-C++. I am presently getting a compile-time error in one of our unit test targets, of "Argument passed to call that takes no arguments" on the following code: let interface = NSXPCInterface(with: XPCServiceDelegate.self) My XPCServiceDelegate protocol is defined as: @objc(XPCServiceDelegate) public protocol XPCServiceDelegate { //... } For the longest time, this code has compiled successfully, and it has not recently changed. There are two confusing things about this error. The first is that I have a different build scheme that will compile correctly other code with the same structure. The other is that I have team members that are able to compile my failing scheme successfully on the same XCode version, OSVersion, and branch of our repository. I've attempted numerous things to try to get this code to compile, but I've run out of ideas. Here's what I've tried: Clean build both on XCode 16.4 and XCode 26 Beta Delete DerivedData and rebuild on XCode 16.4 and XCode 26 Beta Delete and re-clone our git repository Uninstall and reinstall XCode Attempt to locate cached data for XCode and clear it out. (I'm not sure if I got everything that exists on the system for this.) Ensure all OS and XCode updates have been applied. The interface specification for NSXPCInterface clearly has an initializer with one arguement for the delegate protocol, so I don't know why the compiler would fail for this. Is there some kind of forward declaration or shadowing of NSXPCInterface? Do you have any ideas on what I could try next?
10
0
131
Aug ’25
How to use a folder generated by an Xcode Aggregate Target as a resource in another target?
I have a multi target project where every target relies on a built "web bundle" which is basically a collection of html, optimized images, and optimized javascript. Right now that web bundle is built in a pre build step by running a script. The script takes awhile to run and outputs to a folder that is referenced into the project via a PBXFileReference which is then referenced in the Copy Bundle Resources step. 96516AC22BF928DD00576562 /* build */ = {isa = PBXFileReference; lastKnownFileType = folder; name = build; path = "../web-ui/build"; sourceTree = "<group>"; } .... 96516AC32BF928DD00576562 /* build in Resources */ = {isa = PBXBuildFile; fileRef = 96516AC22BF928DD00576562 /* build */; }; As a step, I wrote an aggregate target that can also run this script. I specified its input and output files and turned off sandboxing. It does exactly what I need it to. Critically it is ran based on dependency analysis. If I modify any file in web-ui it rebuilds, if I dont I can repeatedly build the aggregate target and it will not re-run the script. This is perfect. A97590172E419CBA00741928 /* Build Web Bundle */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 12; files = ( ); inputFileListPaths = ( ); inputPaths = ( "$(SRCROOT)/xcodescripts/build-web-bundle.bash", "$(SRCROOT)/web-ui/index.html", "$(SRCROOT)/web-ui/vite-env.d.ts", "$(SRCROOT)/web-ui/vite.config.ts", "$(SRCROOT)/web-ui/tsconfig.json", "$(SRCROOT)/web-ui/stats.html", "$(SRCROOT)/web-ui/postcss.config.js", "$(SRCROOT)/web-ui/package.json", "$(SRCROOT)/web-ui/justfile", "$(SRCROOT)/web-ui/src/", ); name = "Build Web Bundle"; outputFileListPaths = ( ); outputPaths = ( "$(SRCROOT)/web-ui/build/", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "exec \"${SCRIPT_INPUT_FILE_0}\"\n"; }; You may notice I reference a src file. This is made possible via a flag USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES which allows Xcode to check folder dependencies recursively. The problem is that my other targets do not automatically recognize that they need to run the "WebBundle" aggregate target in order to update a resource they copy in their "Copy bundle resources" phase. So I tried adding it as a Target Dependency. A9DE685B2E41C9A8005EF4E0 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = A97590132E419C1200741928 /* WebBundle */; targetProxy = A9DE685A2E41C9A8005EF4E0 /* PBXContainerItemProxy */; }; Unfortunately this breaks whatever magic was allowing the script to be run only when there are web bundle changes. Every build it runs the "Build Web Bundle" script. I think what I am missing is a way to specify in these other targets that a resource they are used to copying from the Xcode PBXFileReference is produced by the aggregate target. This way they can start to reason about the dependencies. Other possibilities are that I should be building the web bundle to a separate location. Or that these references are somehow broken in another way. To be clear the folder format is as thus project/ iOS/ client.xcodeproj web-ui/ build/ (web bundle build is output here and referenced relatively) src/ index.html (and other things)
5
0
91
Aug ’25
AppleClang adds `/usr/local/include` to application search folders
By default, AppleClang adds /usr/local/include to the application search folders for include files (as opposed to the system include dirs). This causes problems with the expected include order because application search folders always have priority over system includes. Specifically it causes problems with the conan package manager as library includes are added with -isystem This behaviour differs from LLVM mainline clang and GCC, where /usr/local/include is a system include (added with -internal-isystem). Steps to reproduce - run echo 'int main() { return 0; }' | clang -xc -v - the output is as follows Apple clang version 17.0.0 (clang-1700.0.13.5) Target: arm64-apple-darwin24.5.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" ... -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -I/usr/local/include -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/local/include ...
1
0
57
Aug ’25
Metal IR reference
Hello! I'm developing a GPU (shader) language, where I aim to target multiple backends with a common frontend. I wanted to avoid having to round trip through Metal, and go straight to IR just like I have with SPIRV, in order to have a fast and efficient compilation process. I've been looking for a reference page where I can read about Metals IR, and as far as I'm aware, it exists, but I can't seem to find it anywhere. Furthermore, if such a reference is available, is there also a toolkit where I can run validation on the output IR, and perhaps even run optimizations, much like spv-tools for SPIRV? Any help would be appreciated! Thanks, Gustav
2
0
228
Jul ’25
"The compiler is unable to type-check this expression..."
"/Users/rich/Work/IdeaBlitz/IdeaBlitz/IdeaListView.swift:30:25 The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions" Is it just me? I get this on syntax errors, missing commas, missing quotes, and for no particular reason at all that I can see. I don't think I've been able to write a single, simple, SwiftUI view without seeing this multiple times. "Breaking it up" just makes it harder to read. Simple, inline, 2-page views become 8-page, totally unreadable, monstrosities. Am I doing something wrong? Or is this just the state of SwiftUI today? Or is there some way to tell the compiler to take more time on this expression? I mean, if these can be broken up automatically, then why doesn't the compiler to that already?
2
0
168
Jul ’25
Complex view structures are frustratingly too much work
The Java Swing and AWT MVC model made it easy to develop complex UIs with data interactions that were not described readily in a nested layer that SwiftUI demands. The implicit update model of SwiftUI greatly complicates development of applications that often requires nested components to have to know too much about other components and other structures than their own, because button events and other user interactions cannot readily alter state across layers. A button push on one component then has to be knowledgable about state in other components which have to have that state represented as @State or @Binding etc. and this causes all kinds of wiring to be spread all over the place rather than have a more centralized "state management function" that would be able to look at the world and synchronize the UIs state across changes. The fact that the compiler get's lost in the weeds when types and signatures don't match in deeper component structures doesn't help because it makes it doubly hard to do refactoring to raise and lower state management within the structure readily, because the compiler just cannot simply tell you that a function or constructor signature is no longer correct.
1
0
89
Jul ’25
Why is SwiftUI so broken and not improving layered UI functionality
Again and and again, I reach the point in a new application where I need to make structural changes in components and my data model, and the SwiftUI compiler fails to compile and just reports "I'm lost in the weeds", with no indication of what it was last working on, aside from a particular level in a multi-layered nested UI. This typically happens when a sub-views construction is not coded correctly because I changed that view and am looking for what broke, by just letting the compiler tell me what is not compatible. This is how refactoring has been done for ages and it's just amazingly frustrating that Apple engineers don't seem to understand nor care about this issue enough to fix it. Why does this problem persist through version after version of SwiftUI? Is no-one actually using it for anything?
1
0
86
Jul ’25
Support Request for XCode Cloud build performance
Dear all, For an important client, we are currently experiencing issues related to performance IOS build using Xcode Cloud. More in detail, their build process is taking approximately 30 minutes to complete at the moment, whereas the same build executed locally on a Mac machine takes around 7 minutes. This significant difference in build times is causing concerns and slowing down the development work. We would appreciate your support in identifying possible causes and exploring different ways to improve the actual situation (ex if it is possible to increase the Cloud machine calculation power). Could you please advise us on how we might proceed to analyze and potentially optimize the build times on Xcode Cloud? What kind of processors are used? Any guidance, best practices, or diagnostic steps you can suggest would be greatly appreciated. Looking forward to your support.
2
0
120
Jul ’25
Circular Reference Error in Xcode 26
I have my project running perfectly fine on Xcode 16. However, in Xcode 26 it doesn't build due to an error that I do not understand. I have three files that pertain to this error: // FriendListResponse.swift import Foundation struct FriendListResponse: Decodable { var friendships: [Friendship] var collections: [FriendCollection] } // Friendship.swift import Foundation struct Friendship: Decodable { var createdAt: String var friendId: Int var friendUserId: Int // user ID of the friend var friendUsername: String var id: Int var tagNames: [String] } // FriendCollection.swift struct FriendCollection: Decodable { var id: Int var permalink: String var tagNames: [String] var title: String } On the first file, FriendListResponse.swift, I am the simple error message "circular reference." I do not understand how these self-contained structs could create a circular reference. Although I have other data types in my project, none of them are even referenced in these files except for Friendship and FriendCollection. The FriendListResponse is a struct that is created from JSON values that are fetched from an API. This is the function that fetches the JSON: public static func listFriends(username: String) async throws -> [Friendship] { let data = try await sendGETRequest( url: "people/\(username)/friends/list.json" ) print(String(data: data, encoding: .utf8)!) let decoder = JSONDecoder() decoder.keyDecodingStrategy = .convertFromSnakeCase let wrapper = try decoder.decode(FriendListResponse.self, from: data) return wrapper.friendships } // Note: the function sendGETRequest is just // a function that I have created that takes a set // of parameters and returns a data object // using the HTTP GET protocol. I don't think // that it is related to this issue. However, if you // think that it is, I can share the code for that. This error has also happened in a few other cases within contained networks of my data structure. I do not know why this error is only appearing once I launch Xcode 26 beta with my project files. I would think that this error also would appear in Xcode 16.4. Any help would be greatly appreciated in my process to compile my project on Xcode 26!
7
0
290
Jun ’25
Auto-Link Behavior Problem
Hi, I encountered an issue in my code where I directly used #import <CoreHaptics/CoreHaptics.h> without adding it to the "Link Binary With Libraries" section under Build Phases. My deployment target is iOS 12, and the code was running fine before; however, after upgrading Xcode, the app crashes immediately on an iOS 12 device with the following error message: DYLD, Library not loaded: /System/Library/Frameworks/CoreHaptics.framework/CoreHaptics | xx | Reason: image not found. Did Xcode modify the default auto-linking configuration? When did this behavior change in which version of Xcode? Do I need to specify CoreHaptics.framework as Optional in "Link Binary With Libraries"? Thanks for reply soon!
1
0
54
Jun ’25
❗️Xcode-beta: “missing required module ‘SwiftShims’” and C99 PCH conflict
Hi all, I’m running into a persistent build issue with my Swift project ORSOFINAL after migrating from Xcode stable to Xcode-beta.app 26 (June 2025 version). ⸻ 💥 Errors displayed: 1. C99 was enabled in PCH file but is currently disabled 2. module file .../ModuleCache.noindex/SwiftShims-AXUM98L131W4...pcm cannot be loaded due to a configuration mismatch with the current compilation 3. missing required module 'SwiftShims' ⸻ 🛠 What I’ve already tried: • xcode-select -s /Applications/Xcode-beta.app/Contents/Developer • Deleted ~/Library/Developer/Xcode/DerivedData, ModuleCache.noindex, Archives, and Products • Ran sudo xcodebuild -runFirstLaunch • Clean Build Folder in Xcode-beta • Verified Command Line Tools setting points to Xcode-beta ⸻ ❓Looking for guidance on: • Whether this is a known bug in Xcode-beta • If SwiftShims/PCM conflicts are expected between versions • Best practices to safely migrate from Xcode stable to beta for Swift-based projects Any advice is much appreciated. Thanks, Mathéo
1
0
87
Jun ’25
Xcode-beta project ORSOFINAL: SwiftShims & C99 PCH errors after migration from Xcode stable
Hi all, I’m running into a persistent build issue with my Swift project ORSOFINAL after migrating from Xcode stable to Xcode-beta.app (June 2025 version). ⸻ 💥 Errors displayed: 1. C99 was enabled in PCH file but is currently disabled 2. module file .../ModuleCache.noindex/SwiftShims-AXUM98L131W4...pcm cannot be loaded due to a configuration mismatch with the current compilation 3. missing required module 'SwiftShims' ⸻ 🛠 What I’ve already tried: • xcode-select -s /Applications/Xcode-beta.app/Contents/Developer • Deleted ~/Library/Developer/Xcode/DerivedData, ModuleCache.noindex, Archives, and Products • Ran sudo xcodebuild -runFirstLaunch • Clean Build Folder in Xcode-beta • Verified Command Line Tools setting points to Xcode-beta ⸻ ❓Looking for guidance on: • Whether this is a known bug in Xcode-beta • If SwiftShims/PCM conflicts are expected between versions • Best practices to safely migrate from Xcode stable to beta for Swift-based projects Any advice is much appreciated. Thanks, Mathéo
1
0
93
Jun ’25
Extract App Intents Metadata build error and SwiftConstValues files not being generated
Hello, We are reaching out to the official forum as an option to help us solve an issue we’re encountering with our app. The problem lies in the implementation of the AppIntents framework in our codebase, which, at the moment, is impossible to complete due to compilation errors occurring in specific targets of our app. We are currently using Xcode 16.0. First of all, we want to clarify that the integration of the AppIntents library poses no issues in our development targets (pre-production environments), since no additional code obfuscation steps are performed there. However, in the release targets used for production builds (those intended to be released to users), we encounter the following compilation error: These errors indicate that the “.swiftconstvalues” files are missing for all of the files in our application. We also want to highlight that we are using a code obfuscation tool called Arxan, provided by Digital.ai. This tool is integrated via specific Build Settings configurations, various files added to the project, and an additional Build Phase script. We have conducted the following tests: Disabling Arxan in release targets: The app compiles successfully and those files are generated (suspicious, I know). Adding a library with AppIntents references and an AppIntent in our app: Both scenarios produce the same compilation error. Creating a demo project with AppIntents and Arxan (basic implementation): The project compiles correctly and those files are in place. Contacting Digital.ai support: They suggested several changes to the Build Settings, but none of them resolved the issue. Additionally, we’ve attempted to gather information from the compiler to understand how these “.swiftconstvalues” files are generated. Unfortunately, we haven’t found any official documentation, so we would like to ask a few questions: Is it possible to interfere with the creation of these files in any way? For example, via scripts or other custom build steps? Is there any way to force the generation of these files through a build parameter or flag? Is it possible to bypass the “Extract App Intents Metadata” step during compilation? If so, what would be the implications of doing this when using a library that includes references to AppIntents? I know that involving a code obfuscation tool raises suspicions about it being the problem, we just want to know a little more about this compilation step to have some more context before reaching them again. Feel free to ask any questions or details, any reply is appreciated. Thanks
3
0
112
Jun ’25
Error in bnns.h - Missing ')'
Greetings! I have an app that builds ad runs just fine in XCode 11 on Catalina on an old Intel MBP. I've recently purchased an M3 Max machine and want to bring this app forward. Just going from XCode 11 to XCode 12 on the old machine, not even trying yet to up to XCode 14 or 15 on the new machine, I get two build errors that I have no idea how to resolve, both in bnns.h. I have not deliberately included this framework, and text search in my project and dependencies finds no incidence of "bnns" at all. These occur in the function prototypes for BNNSApplyMultiheadAttention and BNNSApplyMultiheadAttentionBackward. These prototypes look okay to me, and again I didn't deliberately invoke them in the first place. Does anybody have any idea how I can get past this roadblock? p.s. this is what the first prototype looks like; no unbalanced parens here (spacing edited for readability): int BNNSApplyMultiheadAttention(BNNSFilter F, size_t batch_size, void const* query, size_t query_stride, void const* key, size_t key_stride, BNNSNDArrayDescriptor const* _Nullable key_mask, size_t key_mask_stride, void const* value, size_t value_stride, void *output, size_t output_stride, BNNSNDArrayDescriptor const* _Nullable add_to_attention, size_t * _Nullable backprop_cache_size, void * _Nullable backprop_cache, size_t * _Nullable workspace_size, void * _Nullable workspace)
3
0
92
May ’25
Xcode build system has crashed after adding opencv to macApp
Hi, I am currently working on a MacOS App, where I need the undistortion function of opencv. But after I tried to add opencv to my project, I get following error: unexpected service error: The Xcode build system has crashed. Build again to continue. Cleaning the build folder also doesn't help. Does anyone have an idea what could be the issue? Ryan
0
0
53
May ’25
Xcode does not see code changes in local Swift packages (autocomplete wrong, errors shown, but still compiles)
Hey, I've been having a lot of problems with Xcode 16 not seeing changes made to code in local Swift packages (the packages are inside the root directory of the project). Whenever I make any change like renaming a variable or type, or adding new methods or whatever, autocomplete doesn't see those changes and when I type in that new type/variable manually it gives me an error. However, building the project still works fine, even with the errors never going away. The only way for it to notice the code changes is to clean the project and build it again which takes a long time. At first, I thought this was connected to the new "Explicitly built modules" feature in Xcode 16, but I turned it off and it still happens. Any ideas what I can try? I'm on the latest Xcode version, but this problem has been happening since Xcode 16 originally came out. Thanks! Dennis
0
0
106
May ’25
Apple SDKs should provide libunwind_ext.h on macOS
(Copy pasted from FB17261080 that I submitted) Hi: Apple's SDK (libSystem.B.tbd) provides definition for multiple symbols(__unw_add_dynamic_fde / __unw_add_find_dynamic_unwind_sections ), but doesn't provide corresponding headers, available in LLVM upstream as libunwind_ext.h We need such headers to write Exception-Enabled JIT Framework for macOS
1
0
138
May ’25